using System;
using System.Collections.Generic;
using StructureMap;
using StructureMap.Interceptors;

namespace app
{
    public class InstanceInterceptor : TypeInterceptor
    {
        public InstanceInterceptor() {
            Instances = new List<object>();
        }

        public object Process(object target, IContext context) {
            Instances.Add(target);
            return target;
        }

        public ICollection<object> Instances { get; private set; }

        public bool MatchesType(Type type) {
            return true;
        }
    }
}